/*
 * @Description:
 * @Author: Zzt
 * @Date: 2022-08-27 11:01:50
 * @LastEditTime: 2022-09-15 11:32:44
 */
import {
  SET_CONDITION,
  SET_SELECT_AT,
  SET_SELECT_FOND_ID,
  SET_SELECT_AT_ID,
  SET_FIELDCONDITION
} from '../constants';
export const FullTextReducer = (state, action) => {
  switch (action.type) {
    case SET_CONDITION:
      console.log('reducer', action.data.fondId);
      return { ...state, conditions: action.data };
    case SET_FIELDCONDITION:
      return { ...state, fieldConditionList: action.data };
    /**
     * @description: 设置选中的全宗
     */
    case SET_SELECT_FOND_ID:
      return {
        ...state,
        selectFondId: action.id
      };
    /**
     * @description: 设置选中的档案类型
     */
    case SET_SELECT_AT:
      return {
        ...state,
        selectAT: action.data
      };

    /**
     * @description: 设置选中的档案类型
     */
    case SET_SELECT_AT_ID: {
      return {
        ...state,
        selectATId: action.id
      };
    }
    default:
      console.log('untouched', action);
      return state;
  }
};
